API Docs for: 0.25.0
Show:

file-chooser component Class

This component lets the user choose a list of files from their computer, by drag-and-drop, a file browser, or whatever method the developer wants.

Exposed to parent context (bindable attributes)

  • files: mutable list of chosen File objects
  • multiple: boolean (default true), when false, only keeps the most recently chosen File in the list
  • onChoose: callback function called each time a file is added, with the new File object as the only argument

Exposed to block context

  • this: the component object itself, so the block can invoke actions example:
        {{#file-chooser files=fileList as |component|}}
            {{input type='file'
                change=(action 'onFileInputChange' target=component)}}
        {{/file-chooser}}
    

Actions

  • onFileInputChange: handle the change event on a file input
  • onChooseFile: add a file to the chosen list

Styling

  • This component's element has the drop-zone class
  • While the user is holding dragged files over this component, it has the drop-zone-ready class

Item Index